//
//  ViewController.m
//  wsdlWebService
//
//  Created by wulanzhou on 2017/10/11.
//  Copyright © 2017年 wulanzhou. All rights reserved.
//

#import "ViewController.h"

#import "HttpManager.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    SoapArgs *args = [[SoapArgs alloc] init];
    args.serviceUrlStr = @"https://lighthouse-beta.energyspace.com.au/EnergySpaceWebServices/services/LighthouseServices";
    args.soapBody.nodePrefix = @"web";
    args.soapBody.methodName = @"lighthouseLogin";
    [args.soapBody paramWithObjectsAndKeys:@"paulworkman",@"username",@"paulworkman",@"password", nil];
    
    [[HttpManager shareInstance] requestArgs:args completion:^(WBResponse *response) {
        
        if (response.success) {
             NSLog(@"请求原始结果 =%@",response.xml);
             NSLog(@"xml解析结果 =%@",response.content);
             //重设解析数据源
             [response.parse setDataSource:response.content];
             //解析数据
            NSArray *arr = [response.parse selectNodes:@"//user"];
            NSLog(@"解析内容: %@",arr);
            
        }else{
            NSLog(@"请求失败!");
        }
        
    }];
    
    // Do any additional setup after loading the view, typically from a nib.
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
